package com.vrms.app.service.impl;

import com.vrms.app.entity.Worker;
import com.vrms.app.service.WorkerService;
import com.vrms.app.dao.WorkerDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WorkerServiceImpl implements WorkerService {
    @Resource
    private WorkerDao workerDao;

    @Override
    public List<Worker> listPage(int page, int size, String username) {
        return workerDao.listPage((page-1)*size,size,username);
    }

    @Override
    public int count(String username) {
        return workerDao.count(username);
    }

    @Override
    public boolean save(Worker worker) {
        return workerDao.save(worker)>0;
    }

    @Override
    public boolean update(Worker worker) {
        return workerDao.update(worker)>0;
    }

    @Override
    public boolean remove(int id) {
        return workerDao.remove(id)>0;
    }

    @Override
    public List<Worker> list() {
        return workerDao.list();
    }
}
